/* ==== 全局样式 (兼容IE10+) ==== */
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  /* 盒模型兼容 */
  -ms-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f4f9;
  color: #333;
  padding: 10px;
}

/* ==== 头部样式 ==== */
.header {
  /* Flexbox三模式兼容 */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 10px;
  background-color: #444444;
  border-bottom: 1px solid #ddd;
}

h1 {
  color: orange;
  margin: 0;
  font-size: 24px;
  padding-left: 40px;
  background: url("./logo.svg") no-repeat left center;
  /* 背景尺寸兼容 */
  -webkit-background-size: 32px 32px;
  -moz-background-size: 32px 32px;
  -o-background-size: 32px 32px;
  -ms-background-size: 32px 32px;
  background-size: 32px 32px;
}

/* ==== 工具栏 ==== */
#toolbar {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-gap: 10px;
  -moz-gap: 10px;
  -ms-gap: 10px;
  gap: 10px;
}

#toolbar > * {
  margin-left: 20px;
}

/* ==== 搜索栏 ==== */
#searchBar {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  /* IE10间隙替代 */
  margin-left: -10px;
}

#searchBar > * {
  margin-left: 10px;
}

#searchBar input {
  padding: 8px;
  border: 1px solid #ccc;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  font-size: 14px;
}

#query {
  width: 300px;
}

#searchBar button,
#uploadForm button {
  padding: 8px 16px;
  background-color: #3498db;
  color: white;
  border: none;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  -webkit-transition: background-color 0.3s ease;
  -moz-transition: background-color 0.3s ease;
  -o-transition: background-color 0.3s ease;
  transition: background-color 0.3s ease;
}

/* ==== 上传表单 ==== */
#uploadForm {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  /* IE10间隙替代 */
  margin-left: -10px;
}

#uploadForm > * {
  margin-left: 10px;
}

#uploadForm .btn-upload {
  display: inline-block;
  padding: 8px 16px;
  background-color: #2ecc71;
  color: white;
  border: none;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  -webkit-transition: background-color 0.3s ease;
  -moz-transition: background-color 0.3s ease;
  -o-transition: background-color 0.3s ease;
  transition: background-color 0.3s ease;
}

#uploadForm,
#uploadFile {
  display: none;
}

/* ==== 导航区域 ==== */
#nav {
  height: 36px;
  margin: 10px 0;
  padding: 5px 8px;
  line-height: 26px;
  font-size: small;
  background-color: white;
  border: 1px solid #ddd;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -ms-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* ==== 面包屑导航 ==== */
#breadcrumb {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  /* IE10间隙替代 */
  margin-left: -2px;
}

#breadcrumb > * {
  margin-left: 2px;
}

#breadcrumb span.seperator:not(:last-child):after {
  content: "/";
}

#breadcrumb a.root {
  background-color: #eee;
  padding: 0 5px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
  display: inline-block;
}

#breadcrumb a {
  color: #3498db;
  text-decoration: none;
}

#breadcrumb a:hover {
  text-decoration: underline;
}

#breadcrumb span.current {
  color: #888;
}

/* ==== 文件列表 ==== */
#fileList {
  height: calc(100% - 130px);
  width: 100%;
  background-color: white;
  border: 1px solid #ddd;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  padding: 20px;
  /* 阴影兼容 */
  -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  -o-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  -ms-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  -ms-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

#fileList ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

#fileList ul li {
  padding: 5px 5px 5px 25px;
  border-bottom: 1px solid #eee;
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  font-size: 13px;
  transition: background-color 0.3s ease;
}

#fileList ul li:hover {
  background-color: #eeecec;
  border-bottom-color: #aaa;
}

/* 文件图标兼容处理 */
#fileList ul li.is-file {
  background-image: url("./file.svg");
  background-color: none;
  background-repeat: no-repeat;
  background-position: left center;
  -webkit-background-size: 18px 18px;
  -moz-background-size: 18px 18px;
  -o-background-size: 18px 18px;
  -ms-background-size: 18px 18px;
  background-size: 18px 18px;
}

#fileList ul li.is-dir {
  background-image: url("./dir.svg");
  background-color: none;
  background-repeat: no-repeat;
  background-position: left center;
  -webkit-background-size: 18px 18px;
  -moz-background-size: 18px 18px;
  -o-background-size: 18px 18px;
  -ms-background-size: 18px 18px;
  background-size: 18px 18px;
}

#fileList ul li .name-container {
  width: calc(100% - 250px);
}

#fileList ul li a {
  color: #49697f;
  text-decoration: none;
  /* 文本处理兼容 */
  -ms-word-break: break-all;
  word-break: break-all;
  -webkit-white-space: pre-wrap;
  -moz-white-space: pre-wrap;
  -ms-white-space: pre-wrap;
  white-space: pre-wrap;
  padding: 0 0 0 2px;
  -ms-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

#fileList ul li a:hover {
  color: orange;
  text-decoration: underline;
}

/* #fileList ul li .seperator {
} */

/* ==== 页脚 ==== */
#app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 5px 10px;
  /* Flexbox兼容 */
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -ms-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

/* ==== 其他元素 ==== */
.highlight {
  color: orange;
  font-weight: bold;
}

#backButton {
  padding: 3px 10px;
  background-color: #6c757d;
  color: white;
  border: none;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  -webkit-transition: background-color 0.3s ease;
  -moz-transition: background-color 0.3s ease;
  -o-transition: background-color 0.3s ease;
  transition: background-color 0.3s ease;
}

/* ==== 元信息区域 ==== */
.meta {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  width: 240px;
  -webkit-box-flex: 0;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
  -webkit-box-pack: end;
  -ms-flex-pack: end;
  justify-content: flex-end;
  -webkit-gap: 10px;
  -moz-gap: 10px;
  -ms-gap: 10px;
  gap: 10px;
}

.footer-content a {
  color: orange;
}

/* ==== 消息栏 ==== */
#message-bar {
  padding: 5px 10px;
  text-align: left;
  font-size: small;
  -webkit-box-flex: 1;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
}

#message-bar.info {
  color: #555555;
}
#message-bar.success {
  color: #2e7d32;
}
#message-bar.error {
  color: #c62828;
}
#message-bar.warn {
  color: #f57c00;
}

/* 上传对话框遮罩层 */
#upload-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* 半透明背景 */
  display: none; /* 默认隐藏 */
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  z-index: 1000; /* 确保在其他元素之上 */
  /* 添加淡入动画 */
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#upload-dialog.is-visible {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex; /* 显示对话框 */
}

/* 上传对话框内容 */
.upload-content {
  background-color: #ffffff; /* 白色背景 */
  padding: 15px;
  -webkit-border-radius: 0.8rem;
  -moz-border-radius: 0.8rem;
  border-radius: 0.8rem; /* 圆角边框 */
  width: 800px;
  -webkit-box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  -o-box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  -ms-box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* 增强阴影效果 */
  /* 添加缩放动画 */
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
  }
  to {
    transform: scale(1);
  }
}

/* 上传标题样式 */
.upload-title {
  font-size: 1.3rem; /* 增大字体大小 */
  font-weight: 600; /* 调整字体粗细 */
  color: #333333;
  margin-bottom: 10px;
  text-align: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee; /* 添加下划线 */
}

/* 单选框和标签样式 */
input[type="radio"] {
  /* 隐藏默认的单选框 */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 20px; /* 增大尺寸 */
  height: 20px;
  border: 2px solid #ccc; /* 默认边框颜色 */
  border-radius: 50%; /* 圆形 */
  outline: none;
  transition: all 0.3s ease; /* 添加过渡效果 */
  position: relative;
  vertical-align: middle;
  margin-right: 0.8rem; /* 调整间距 */
}

input[type="radio"]:hover {
  border-color: #007bff; /* 鼠标悬停时改变边框颜色 */
}

input[type="radio"]:checked {
  border-color: #007bff; /* 选中时的边框颜色 */
  background-color: #007bff; /* 选中时的背景颜色 */
}

input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px; /* 选中标记的尺寸 */
  height: 10px;
  background-color: white; /* 选中标记的颜色 */
  border-radius: 50%; /* 圆形标记 */
}

label {
  color: #333333;
  margin-right: 1.5rem;
  vertical-align: middle;
  cursor: pointer;
  transition: color 0.3s ease; /* 标签颜色过渡效果 */
}

label:hover {
  color: #007bff; /* 鼠标悬停时标签颜色变化 */
}

/* 上传区域样式 */
#upload-local,
#upload-url {
  margin-top: 10px; /* 增大间距 */
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #eee; /* 添加边框 */
  border-radius: 0.5rem; /* 圆角边框 */
}

/* 输入框样式 */
input[type="file"],
input[type="text"] {
  width: 100%;
  padding: 10px; /* 增大内边距 */
  border: 1px solid #ddd;
  -webkit-border-radius: 0.5rem;
  -moz-border-radius: 0.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  -ms-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box; /* 确保内边距和边框不会影响元素的总宽度 */
}

input[type="file"]:focus,
input[type="text"]:focus {
  border-color: #007bff; /* 聚焦时改变边框颜色 */
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2); /* 添加聚焦阴影 */
}

/* 按钮样式 */
button {
  padding: 8px 15px; /* 增大内边距 */
  border: none;
  -webkit-border-radius: 0.5rem;
  -moz-border-radius: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  -webkit-transition: background-color 0.3s ease, transform 0.1s ease;
  -moz-transition: background-color 0.3s ease, transform 0.1s ease;
  -o-transition: background-color 0.3s ease, transform 0.1s ease;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

button:hover {
  -webkit-opacity: 0.9;
  -moz-opacity: 0.9;
  opacity: 0.9;
  transform: translateY(-1px); /* 鼠标悬停时上移 */
}

button:active {
  transform: translateY(0); /* 鼠标按下时恢复原位 */
}

/* 确定按钮样式 */
#btn-upload-ok {
  background-color: #007bff;
  color: #ffffff;
  margin-right: 0.5rem;
}

#btn-upload-ok:disabled {
  background-color: #b0d2f7;
  cursor: not-allowed;
  transform: none; /* 禁用时不应用动画 */
}

/* 取消按钮样式 */
#btn-upload-cancel {
  background-color: #6c757d;
  color: #ffffff;
}

/* 上传对话框底部样式 */
.upload-footer {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-top: 2rem; /* 增大间距 */
}

/* 上传消息显示区域样式 */
.upload-message {
  font-size: 1rem; /* 增大字体大小 */
  color: #666;
  word-break: break-word;
  max-width: 600px; /* 限制最大宽度 */
}

/* 上传按钮区域样式 */
.upload-buttons {
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-gap: 1rem;
  -moz-gap: 1rem;
  -ms-gap: 1rem;
  gap: 1rem; /* 增大间距 */
  width: auto; /* 自动宽度 */
  -webkit-box-flex: 0;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
}

.tip {
  font-size: 0.9rem;
  color: #888;
  margin-top: 0.5rem;
  display: block; /* 显示为块级元素 */
}

#realUrl {
  width: 100%; /* 宽度充满父容器 */
  height: 50px; /* 增大高度 */
  flex: 1 1 auto;
  outline: none;
  padding: 0.8rem;
  border: 1px solid #ddd;
  -webkit-border-radius: 0.5rem;
  -moz-border-radius: 0.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

#realUrl:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

#fileInfo {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

#fileInfo > div {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}

#fileInfo label {
  word-break: keep-all;
  white-space: nowrap;
  min-width: 120px; /* 固定标签宽度 */
}

/* 遮罩层样式 */
#preview-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
}
.preview-overlay {
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 80%;
  height: 90%;
  border-radius: 4px;
  position: relative;
  transition: width 0.3s ease, height 0.3s ease;
}

#preview-dialog.fullscreen .preview-overlay {
  width: 100%;
  height: 100%;
}

/* 预览头部样式 */
.preview-header {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid #eee;
  height: 50px;
  gap: 20px;
}

#btn-preview-fullscreen {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 1px solid #eee;
  border-radius: 4px;
  cursor: pointer;
  color: orange;
  font-size: small;
  padding: 2px 3px;
}

#btn-preview-fullscreen:hover {
  border-color: orange;
}

/* 预览内容样式 */
#preview-container {
  height: calc(100% - 100px);
  padding: 20px;
  box-sizing: border-box;
}

#preview-container textarea {
  word-break: break-all;
  white-space: pre-wrap;
  width: 100%;
  height: 100%;
  overflow: auto;
  border-color: #eeeeee;
  outline: none;
  resize: none;
  padding: 10px;
  box-sizing: border-box;
}

#preview-container iframe {
  width: 100%;
  height: 100%;
  overflow: auto;
  border-color: #eeeeee;
  outline: none;
}

#preview-container .preview-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#preview-container img {
  max-width: 100%;
  max-height: 100%;
  border-color: #eeeeee;
  outline: none;
}

/* 预览底部样式 */
.preview-footer {
  height: 50px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 10px;
  border-top: 1px solid #eee;
  gap: 10px;
}

.preview-footer {
  text-decoration: none;
}

#btn-preview-download button {
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: orange;
  color: white;
  text-decoration: none;
  display: inline-block;
}

#btn-preview-download button:hover {
  background-color: rgb(243, 177, 53);
}

.preview-header--prefix {
  color: orange;
}
